package com.example.jh352160.surfingtv.category.customView.adapter;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;

import com.example.jh352160.surfingtv.category.customView.Subscribe_item;

import java.util.List;

/**
 * Created by jh352160 on 2016/7/25.
 */

public class SubscribeListAdapter extends ArrayAdapter<Subscribe_item> {

    List<Subscribe_item> itemList;
    Context context;
    int resource;

    public SubscribeListAdapter(Context context, int resource, List<Subscribe_item> datas) {
        super(context, resource, datas);
        itemList = datas;
        this.context = context;
        this.resource = resource;
    }

    @Override
    public int getCount() {
        return itemList.size();
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        Subscribe_item item = itemList.get(position);
//        item.setOnClickListener(new View.OnClickListener() {
//            @Override
//            public void onClick(View view) {
//                context.startActivity(new Intent(context, ThematicDetailsPage.class));
//            }
//        });
        return item;
    }
}
